package zack.project.domain.trade.service.refund;

import zack.project.domain.trade.model.entity.TradeRefundBehaviorEntity;
import zack.project.domain.trade.model.entity.TradeRefundCommandEntity;
import zack.project.domain.trade.service.ITradeRefundService;
import zack.project.domain.trade.service.refund.factory.TradeRefundRuleFilterFactory;
import zack.project.types.design.framework.link.model2.chain.BusinessLinkedList;

import javax.annotation.Resource;

/**
 * @author A1793
 */
public class TradeRefundService implements ITradeRefundService {

    @Resource
    BusinessLinkedList<TradeRefundCommandEntity,
            TradeRefundRuleFilterFactory.DynamicContext,
            TradeRefundBehaviorEntity> refundFilter;

    @Override
    public TradeRefundBehaviorEntity refund(TradeRefundCommandEntity tradeRefundCommandEntity) throws Exception {
        return refundFilter.apply(tradeRefundCommandEntity,new TradeRefundRuleFilterFactory.DynamicContext());
    }
}
